<?php
/*
 * content : 路由注册配置
 * Author  : Songyicong 
 * time    : 2018-04-20 09:46:22 
 * email   : m13726262373@163.com 
 */
use think\Route;
Route::resource('/','index/index');

Route::resource(':version/test','api/:version.test');
// 用户权限访问
Route::resource(':version/user','api/:version.User');
// 获取令牌操作
Route::group('api/:version/token', function () {
	Route::any('','api/:version.Token/setAccessToken');
	Route::any('/refresh','api/:version.Token/referAccessToken');
});
// 生成后台用户操作
Route::group('admin/:version/user', function () {
	Route::post('/create','api/:version.Admin/setUser');
	Route::post('/login','api/:version.Login/getLoginAdmin');
});
// 注册操作
Route::group('api/:version/regist', function () {
	Route::post('/email','api/:version.Regist/setRegistEmail');
	Route::post('/email_code','api/:version.Regist/updateEmailCode');
	Route::post('/email_code_judge','api/:version.Regist/isVerifyEmailCode');
});
// 登录操作
Route::group('api/:version/login', function () {
	Route::post('/normal','api/:version.Login/getLoginNormal');
	Route::post('/email','api/:version.Login/getLoginEmail');// 邮箱登录
	Route::post('/email_judge','api/:version.Login/isVerifyEmailCode');// 邮箱验证
	Route::any('/wechat','api/:version.Login/wechatLogin');// 微信登录
	Route::post('/wechat_callback','api/:version.WechatRedirect/wechatCallback');// 微信登录回调
});
// 跳转到未定义路由
Route::miss('error/error/index');

